package com.five.service.Impl;

import com.five.dao.ClubInformDao;
import com.five.pojo.ClubInform;
import com.five.service.ClubInformService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

@Service
public class ClubInformServiceImpl implements ClubInformService {
    @Autowired
    private ClubInformDao clubInformDao;
    @Override
    public void addInform(ClubInform clubInform) {
        clubInform.setCReTime(LocalDateTime.now());
        clubInform.setStatus(1);
        clubInformDao.addInform(clubInform);
    }

    @Override
    public void ModStatus(Integer status, Integer id) {
        clubInformDao.ModStatus(status , id);
    }

    @Override
    public List<ClubInform> findInform() {
        List<ClubInform> clubInformList = clubInformDao.findInform();
        return clubInformList;
    }

    @Override
    public void deleteInform(Integer id) {
        clubInformDao.deleteInform(id);
    }

    @Override
    public void updateInForm(ClubInform clubInform) {
        clubInform.setCReTime(LocalDateTime.now());
        clubInform.setStatus(1);
        clubInformDao.updateInForm(clubInform);
    }
}
